<template>
	<div class="modify-dialog">
		<slot> </slot>
		<el-dialog v-bind="dialogOpts" :visible.sync="dialogVisible">
			<Form v-bind="formOpts" v-on="formEvent">
				<template #formSuf>
					<el-form-item label="回款截图" style="width: 100%">
						<Uploader v-model="fileList" />
					</el-form-item>
				</template>
				<template #formBtn>
					<div class="dialog-footer">
						<el-button @click="dialogVisible = false">取 消</el-button>
						<el-button type="primary" @click="onConfirm"> 确 定 </el-button>
					</div>
				</template>
			</Form>
		</el-dialog>
	</div>
</template>

<script>
import modifyMixins from "@/mixins/modifyMixins.vue";

export default {
	mixins: [modifyMixins],
	data () {
		return {
			dialogTitle: '回款',
			labelPosition: "left",
			form: {
				amount: {
					tag: "el-input",
					label: "回款金额",
					value: "",
					props: {
						type: "number",
						min: 0,
						placeholder: "请输入回款金额",
					},
				},
			},
		};
	},
	computed: {},
	methods: {
		onSubmit (form) {
			const { modify, row, fileList } = this;
			if (!form.amount) return this.$message.error("请输入金额");
			if (!fileList[0]) return this.$message.error("请上传图片");
			form.prove = fileList[0];
			form.orderId = row.id;
			
			// newPaymentCreate
			this.$api["orderAddPayment"](form).then(this.submitDoneMsg);
		},
	},
};
</script>

<style lang="less" scoped></style>

